﻿using System;
using System.Collections.Generic;
using Logistics.Web.Models.Common;
using Nop.Core.Domain.Shipping;
using Nop.Web.Framework;
using Nop.Web.Framework.Mvc;

namespace Logistics.Web.Models.Shipment
{
    public partial class ShipmentDetailsModel : BaseNopEntityModel
    {
        public ShipmentDetailsModel()
        {
            ShipmentStatusEvents = new List<ShipmentStatusEventModel>();
        }

        public int PackageId { get; set; }
        public string TrackingNumber { get; set; }
        public string TrackingNumberUrl { get; set; }
        public string PackageAttributes { get; set; }
        public DateTime? ShippedDate { get; set; }
        public DateTime? DeliveryDate { get; set; }
        public IList<ShipmentStatusEventModel> ShipmentStatusEvents { get; set; }
        public string Status { get; set; }
        public string Comment { get; set; }
        public IList<DisplayedShipmentStatusEvent> DisplayedEvents { get; set; }
        public int DisplayedEventsBarLocation { get; set; }
        public int DisplayedStatusType { get; set; }
        public bool ShowDetails { get; set; }

        public string PickUpTimeShow { get; set; }

        //this time  user selected
        public string PickupTimeUserSelected { get; set; }

        //for displaying the shipment status event model
        public bool ShowShipmentCountry { get; set; }
        public bool ShowShipmentLocation { get; set; }
        public bool ShowShipmentTime { get; set; }

        public AddressModel PickupAddress { get; set; }
        public AddressModel DeliveryAddress { get; set; }
        public bool CanCancel { get; set; }
        public bool IsChangePickupAddressFree { get; set; }
        public bool IsChangeDeliveryAddressFree { get; set; }
        public bool IsScheduleDeliveryFree { get; set; }
        public bool IsCancelPackageFree { get; set; }
        public bool CanChangeDeliveryAddress { get; set; }
        public bool CanChangePickupAddress { get; set; }
        public bool CanScheduleDelivery { get; set; }
        public bool CanChangeComment { get; set; }
        public IList<RecentlyViewedShipment> RecentlyViewedShipmentHistory { get; set; }
        public string NextTrackingName { get; set; }

        #region Nested Classes

        public partial class ShipmentStatusModel : BaseNopModel
        {
            public int StatusCode { get; set; }
            public string Status { get; set; }
        }

        public partial class ShipmentStatusEventModel : BaseNopModel
        {
            public string EventName { get; set; }
            public string Location { get; set; }
            public string Country { get; set; }
            public string Date { get; set; }
            public string Time { get; set; }
        }

        public class DisplayedShipmentStatusEvent
        {
            public string EventName { get; set; }
            public int BarWidth { get; set; }
        }

        public class RecentlyViewedShipment
        {
            public string EventName { get; set; }
            public int Type { get; set; }
            public int ShipmentId { get; set; }
            public string TrackingNumber { get; set; }
            public DateTime LastUpdatedDateTime { get; set; }
        }
        #endregion 
    }
}